<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org" th:fragment="part">
	<head>
		<title>viewOUser</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}" />
        <script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
        <script type="text/javascript" src="../js/om/hrmlog.js"></script>
        <script type="text/javascript" src="../js/om/showAddOUser.js"></script>
	</head>
	<body id="body">
		<div id="wrap">
            <div id="wrapper">
                <ul class="first">
                    <li><a href="/om/viewOUser">组织党员管理</a></li>
                    <li><a href="/om/viewDGroup">组织管理</a></li>
                    <li><a href="/om/viewOPost">组织帖子管理</a></li>
                </ul>
            </div>
            <div id="big">
                <div id="top_content">
                    <div id="content">
                        <form th:action="@{search}" method="get" enctype="multipart/form-data">
                            <p>
                                <input id="button1" type="button" style="width: 75px" class="button" value="添加" onclick="showAddOUser()"/>
                                <tr>
                                    <td valign="middle" align="left">
                                        <label>姓名：</label>
                                        <input id="search" type="text" name="realname" value="">
                                        <input  type="submit" style="width: 75px" class="button" value="搜索" onclick="f()"/>
                                        <script>
                                            function f() {
                                                var a=document.getElementById("search").value;

                                            }
                                        </script>

                                    </td>
                                </tr>
                            </p>

                            <table class="table" >
                                <tr class="table_header">
                                    <td width="205px">
                                        用户名
                                    </td>
                                    <td width="185px">
                                        姓名
                                    </td >
                                    <td width="195px">
                                        角色
                                    </td>
                                    <td width="215px">
                                        党支部
                                    </td>
                                    <td width="185px">
                                        手机号
                                    </td>
                                    <td width="215px">
                                        操作
                                    </td>
                                </tr>
                            </table>
                            <table class="table" id="adminTbody" >
                                <tr  th:each="ousers,ouserstate:${ousers}" th:class="${ouserstate.odd?'row1':'row2'}">
                                    <td width="205px">
                                        <span th:text="${ousers.username}"></span>
                                    </td>
                                    <td width="185px">
                                        <span th:text="${ousers.realname}"></span>
                                    </td>
                                    <td width="195px">
                                        <span th:text="${ousers.role}"></span>
                                    </td>
                                    <td width="215px">
                                        <span th:text="${ousers.gname}"></span>
                                    </td>
                                    <td width="185px">
                                        <span th:text="${ousers.phone}"></span>
                                    </td>
                                    <td width="215px">
<!--                                        <a th:href="@{updateOUser(username=${ousers.username})}">删除</a>-->
                                       <a th:href="@{modifyOUser(username=${ousers.username})}">更新</a>
                                        <a href="javascript:;" th:onclick="updateOUser([[${ousers.username}]])">删除</a>
                                    </td>
                                </tr>
                                <script>
                                    function updateOUser(username){
                                        console.log(username);
                                        if(window.confirm('确定要删除吗?')){
                                            location.href='[[@{updateOUser?username=}]]'+username;
                                        }
                                    }
                                </script>
                            </table>
                            <div class="layui-card-body ">
                                <div class="page">
                                    <div>
                                        <a class="num" href="###" id="firstPage">首页</a>
                                        <a class="prev" href="###" id="prePage">&lt;&lt;</a>
                                        <span class="current" id="currentPage"></span>
                                        <a class="next" href="###"id="nextPage">&gt;&gt;</a>
                                        <a class="num" href="###" id="lastPage">尾页</a>
                                        <a class="num" href="###" id="totalpage"></a>
                                        <a class="num"> <select  id="jumpWhere"> </select></a>
                                        <a href="###" id="jumpPage" onclick="jumpPage()">跳转</a>
                                        <a class="num" id="countsum"></a>
                                    </div>
                                </div>
                            </div>
                        </form>

                        <div id="showAddOUser" style="display: none">
                            <div id="showAdd">
                                <div id="showhead">
                                    <span>添加</span>
                                    <img id="x" src="../../images/badge/quxiao.png" width="25" height="25" onclick="hiden_showAddOUser()">
                                </div>
                                <div id="addbody">
                                    <form th:action="@{insertOUser}" method="get" enctype="multipart/form-data">
                                        <table  cellpadding="0" cellspacing="0" border="0"
                                                class="formtable" >
                                            <tr>
                                                <td valign="middle" align="right">
                                                    姓名:
                                                </td>
                                                <td valign="middle" align="left">
                                                    <select  class="showselect" id="inputname" style="width: 200px" name="realname">
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="middle" align="right">
                                                    组织:
                                                </td>
                                                <td valign="middle" align="left">
                                                    <select class="showselect" id="inputgroup" style="width: 200px" name="gname">
                                                    </select>
                                                </td>
                                            </tr>
                                        </table>
                                        <p>
                                            <input id="button2" type="submit" style="width: 75px" class="button4" value="确认添加" onclick="hiden_showAddOUser()"/>
                                            <input id="button3" type="button" style="width: 75px" class="button4" value="返回" onclick="hiden_showAddOUser()"/>
                                        </p>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
		</div>
	</body>
</html>
